<?
include "../lib/cfg.class.php";
function cut_str($str, $len, $suffix="…")
{
    global $g4;

    $s = substr($str, 0, $len);
    $cnt = 0;
    for ($i=0; $i<strlen($s); $i++)
        if (ord($s[$i]) > 127)
            $cnt++;
    if (strtoupper($g4['charset']) == 'UTF-8')
        $s = substr($s, 0, $len - ($cnt % 3));
    else
        $s = substr($s, 0, $len - ($cnt % 2));
    if (strlen($s) >= strlen($str))
        $suffix = "";
    return $s . $suffix;
}


$db = new my_class();
$db->query("SET NAMES UTF8");
$db->query("SELECT * FROM `jn_ev_product` WHERE `evp_useflag`='Y' AND `evp_main_chk`='Y' LIMIT 6");

while($arr = @mysql_fetch_array($db->re)) {
	$title = strip_tags(str_replace('"',"'",$arr[evp_subject]));
	$title = cut_str($title,38);
	$evp_no = $arr[evp_no];
	$img = $arr[evp_titleimg_file];

	echo "
	<이미지정보 txt1=\"".$title."\" txt2=\"".$title."\" link=\"/evp_view.php?evp_no=".$evp_no."\" frame=\"_blank\">
		<카테고리이미지1 imgURL=\"/jn_event/upload/".$img."\" />
	</이미지정보>
	";
 }  ?>